import request from '@/utils/request'

export function activitylist(query) {
  return request({
    url: '/activity/list',
    method: 'get',
    params: query
  })
}

export function activityDetail(id) {
  return request({
    url: '/activity/read',
    method: 'get',
    params: { id }
  })
}

export function activityGrouponList(query) {
  return request({
    url: '/activity/activityGroupon/list',
    method: 'get',
    params: query
  })
}

export function exportGrouponList(query) {
  return request({
    url: '/activity/activityGroupon/exportList',
    method: 'get',
    params: query
  })
}

export function createActivity(data) {
  return request({
    url: '/activity/create',
    method: 'post',
    data
  })
}

export function updateActivity(data) {
  return request({
    url: '/activity/edit',
    method: 'post',
    data
  })
}

export function changeActivityState(data) {
  return request({
    url: '/activity/changeState',
    method: 'post',
    data
  })
}

export function changeUserType(data) {
  return request({
    url: '/activity/activityGroupon/changeUserType',
    method: 'post',
    data
  })
}

export function replaceCaptain(data) {
  return request({
    url: '/activity/activityGroupon/replaceCaptain',
    method: 'post',
    data
  })
}

export function listGrouponUser(data) {
  return request({
    url: '/activity/activityGroupon/grouponUserList',
    method: 'post',
    data
  })
}

export function changeGroupon(data) {
  return request({
    url: '/activity/activityGroupon/changeGroupon',
    method: 'post',
    data
  })
}

export function listActivityGroupon(data) {
  return request({
    url: '/activity/activityGroupon/listActivityGroupon',
    method: 'post',
    data
  })
}

export function independent(data) {
  return request({
    url: '/activity/activityGroupon/independent',
    method: 'post',
    data
  })
}
